#include <REG52.H>
#include <string.h>
#include "Delay.h"

unsigned int keyBit = 0;
sbit key1 = P2 ^ 1;
sbit key2 = P2 ^ 0;
void PressKey(char* name, void (*cb)()) {
    if (strstr(name, "key1")){
        if(key1 == 0){
            Delay(20);
            while(key1 == 0);
            Delay(20);
            cb();
        }
    }else{
        if(key2 == 0){
            Delay(20);
            while(key2 == 0);
            Delay(20);
            cb();
        }


    }
}